#include "Pch.h"
#include "Buffer.h"
#include "Renderer.h"
#include "Platform\OpenGL\OpenGLBuffer.h"
#include "Engine\Log.h"
namespace Engine
{
	VertexBuffer* VertexBuffer::Create(float* vertics, UINT32 size)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None:
			ENGINE_ERROR("RendererAPI::None is currently not supported!");
			return nullptr;
		case RendererAPI::API::OpenGL:
			return new GLVertexBuffer(vertics, size);
		}

		ASSERT(false, "Unknown API");
		return nullptr;
	}
	IndexBuffer* IndexBuffer::Create(UINT32* vertics, UINT32 size)
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None:
			ENGINE_ERROR("RendererAPI::None is currently not supported!");
			return nullptr;
		case RendererAPI::API::OpenGL:
			return new GLIndexBuffer(vertics, size);
		}

		ASSERT(false, "Unknown API");
		return nullptr;
	}
}